package com.fengchunge.service.impl;

import com.fengchunge.common.ServerResponse;
import com.fengchunge.dao.UserInfoBackupMapper;
import com.fengchunge.pojo.UserInfo;
import com.fengchunge.service.IEncounterUserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

/**
 * @description: service
 * @author: mingtai
 * @createDate: 22:54 2021/4/26
 * @version: 1.0
 */


@Slf4j
@Service("IEncounterUserService")
public class EncounterUserServiceImpl implements IEncounterUserService {

    @Autowired
    private UserInfoBackupMapper userInfoBackupMapper;

    @Override
    public ServerResponse<String> statisticUser(UserInfo userInfo) {
        userInfo.setCreateTime(new Date());
        userInfo.setUpdateTime(new Date());
        int insertSelective = userInfoBackupMapper.insertSelective(userInfo);
        if (insertSelective <= 0) {
            return ServerResponse.createByErrorMessage("上报失败,请稍后重试~");
        }
        return ServerResponse.createBySuccessMessage("操作成功");
    }

    @Override
    public ServerResponse<UserInfo> getUserInfo(String id) {
        return null;
    }
}



